package com.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cloud.domain.TbUser;
import com.user.dao.UserMapper;
import com.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @version 1.0
 * @author: yu.tan
 * @date: 2020/10/12 22:28
 * @Description:
 */
@Service
@Slf4j
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    @Qualifier("OneUser")
    private TbUser oneUser;

    @Override
    public TbUser findOne() {

        QueryWrapper<TbUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",1);

        TbUser one = userMapper.selectOne(queryWrapper);
        return one;
    }

    @Override
    public TbUser testA() {
        log.info("获取已加载数据：{}",oneUser);
        return oneUser;
    }
}
